home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / TIFF Code.cpt / tifflib.h < prev    next >
Text File  |  1987-12-16  |  3KB  |  144 lines

  1. /* Copyright (c) 1987, DEST Corporation */
  2.  
  3. /*
  4.  * Header file for Tag Image File Format (TIFF) routines.
  5.  * Originated at Dest, modified at Bear River Associates.
  6.  */
  7.  
  8. #ifndef    _BASICS
  9.  
  10. typedef    short                Int16;
  11. typedef    unsigned short        UInt16;
  12.  
  13. typedef    long                Int32;
  14. typedef    unsigned long        UInt32;
  15.  
  16. typedef    char                Int8;
  17. typedef    unsigned char        UInt8;
  18. typedef    unsigned char        Byte;
  19. typedef    char                SignedByte;
  20.  
  21. #define    NIL                    (0L)
  22. #define    TRUE                (-1)
  23. #define    FALSE                0
  24.  
  25. #define    _BASICS
  26. #endif
  27.  
  28. #ifndef _TIFFLIB_H
  29.  
  30. /* TIFF data types */
  31.  
  32. #define BYTE        1
  33. #define ASCII        2
  34. #define SHORT        3
  35. #define LONG        4
  36. #define RATIONAL    5
  37.  
  38. #define BYTESIZE    1 
  39. #define ASCIISIZE    1
  40. #define SHORTSIZE    2
  41. #define LONGSIZE    4
  42. #define RATSIZE        8
  43.  
  44. struct Rational
  45. {
  46.         Int32 numerator;
  47.         Int32 denominator;
  48. };
  49. typedef struct Rational Rational;
  50.  
  51. struct TiffHeader
  52. {
  53.         Int16 byteOrder;
  54.         Int16 version;
  55.         Int32 dirOffset;
  56. };
  57. typedef struct TiffHeader TiffHeader ;
  58.  
  59. struct TiffDirEntry
  60. {
  61.         Int16 tag;
  62.         Int16 type;
  63.         Int32 length;
  64.         Int32 valueOffset;
  65. };
  66. typedef struct TiffDirEntry TiffDirEntry ;
  67.  
  68. struct FieldInfo
  69. {
  70.         Int16 numTags;
  71.         Int32 numBytes;
  72. };
  73. typedef struct FieldInfo FieldInfo ;
  74.  
  75. /* constants */
  76. #define INTEL                    0x4949
  77. #define MOTOROLA                0x4d4d
  78.  
  79. /* tags */
  80. #define SUBFILE_TYPE_TAG        0x00ff
  81. #define IMAGE_WIDTH_TAG         0x0100
  82. #define IMAGE_LENGTH_TAG        0x0101
  83. #define BITS_PER_SAMPLE_TAG     0x0102
  84. #define COMPRESSION_TAG         0x0103
  85.  
  86. #define PHOTOMETRIC_INTERP_TAG  0x0106
  87. #define THRESHOLDING_TAG        0x0107
  88. #define CELL_WIDTH_TAG          0x0108
  89. #define CELL_LENGTH_TAG         0x0109
  90. #define FILL_ORDER_TAG          0x010a
  91.  
  92. #define DOCUMENT_NAME_TAG       0x010d
  93. #define IMAGE_DESCRIPTION_TAG   0x010e
  94. #define MAKE_TAG                0x010f
  95. #define MODEL_TAG               0x0110
  96. #define STRIP_OFFSETS_TAG       0x0111
  97. #define ORIENTATION_TAG         0x0112
  98. #define SAMPLES_PER_PIXEL_TAG   0x0115
  99. #define ROWS_PER_STRIP_TAG      0x0116
  100. #define STRIP_BYTE_COUNTS_TAG   0x0117
  101. #define MIN_SAMPLE_VALUE_TAG    0x0118
  102. #define MAX_SAMPLE_VALUE_TAG    0x0119
  103. #define X_RESOLUTION_TAG        0x011a
  104. #define Y_RESOLUTION_TAG        0x011b
  105. #define PLANAR_CONFIG_TAG       0x011c
  106. #define PAGE_NAME_TAG           0x011d
  107. #define X_POSITION_TAG          0x011e
  108. #define Y_POSITION_TAG          0x011f
  109. #define FREE_OFFSETS_TAG        0x0120
  110. #define FREE_BYTE_COUNTS_TAG    0x0121
  111. #define UNITS_GRAY_RESPONSE        0x0122
  112. #define CURVE_GRAY_RESPONSE        0x0123
  113.  
  114. #define numTagTypes                29
  115.  
  116. /*
  117.  * Legal compression types.  See the description of the "Compression" tag
  118.  * in the "Tag Image File Format" abstract.
  119.  *
  120.  */
  121. #define PACK_TIGHTLY            1
  122. #define ONE_D_MOD_HUFFMAN        2
  123.  
  124. /*
  125.  * version number.
  126.  */
  127. #define LEGAL_VERSION            42
  128.  
  129. Boolean    TFindTag();
  130. void    TGetTag();
  131. OSErr    TPutPtrTag();
  132. OSErr    TPutHdlTag();
  133. OSErr    TReadHeader();
  134. OSErr    TWriteHeader();
  135. OSErr    TReadTags();
  136. OSErr    TWriteTags();
  137. OSErr    TReadImage();
  138. OSErr    TWriteImageStrip();
  139. void    TFixOddRowBytes();
  140. void    TUnfixOddRowBytes();
  141.  
  142. #define _TIFFLIB_H
  143. #endif
  144.